}));
let deps = line.slice_from(pos + 2);
- for file in deps.split(' ').map(|s| s.trim()).filter(|s| !s.is_empty()) {
- match fs::stat(&pkg.get_root().join(file)) {
+ let mut deps = deps.split(' ').map(|s| s.trim()).filter(|s| !s.is_empty());
+ loop {
+ let mut file = match deps.next() {
+ Some(s) => s.to_string(),
+ None => break,
+ };
+ while file.as_slice().ends_with("\\") {
+ file.pop();
+ file.push(' ');
+ file.push_str(deps.next().unwrap())
+ }
+ match fs::stat(&pkg.get_root().join(file.as_slice())) {
Ok(stat) if stat.modified <= mtime => {}
Ok(stat) => {
debug!("stale: {} -- {} vs {}", file, stat.modified, mtime);
.with_stderr("\
Package `bar v0.0.0 ([..])` has no library targets"));
})
+
+test!(recompile_space_in_name {
+ let foo = project("foo")
+ .file("Cargo.toml", r#"
+ [package]
+ name = "foo"
+ version = "0.0.0"
+ authors = []
+
+ [lib]
+ name = "foo"
+ path = "src/my lib.rs"
+ "#)
+ .file("src/my lib.rs", "");
+ assert_that(foo.cargo_process("build"), execs().with_status(0));
+ foo.root().move_into_the_past().assert();
+ assert_that(foo.process(cargo_dir().join("cargo")).arg("build"),
+ execs().with_status(0).with_stdout(""));
+})